package cn.edu.ujn.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.ujn.dao.BaseDict;
import cn.edu.ujn.dao.BaseDictMapper;

@Service
@Transactional
public class BaseDictServiceImpl implements IBaseDictService {
	@Autowired
	private BaseDictMapper baseDictMapper;

	@Override
	public BaseDict selectBaseDict(String dictId) {
		// TODO Auto-generated method stub
		BaseDict baseDict = baseDictMapper.selectByPrimaryKey(dictId);
		return baseDict;
	}

	@Override
	public int addBaseDict(BaseDict baseDict) {
		// TODO Auto-generated method stub
		int insert = baseDictMapper.insert(baseDict);
		return insert;
	}

	@Override
	public int deleteBaseDict(String dictId) {
		// TODO Auto-generated method stub
		int primaryKey = baseDictMapper.deleteByPrimaryKey(dictId);
		return primaryKey;
	}

	@Override
	public int updateBaseDict(BaseDict baseDict) {
		// TODO Auto-generated method stub
		int key = baseDictMapper.updateByPrimaryKey(baseDict);
		return key;
	}

	@Override
	public List<BaseDict> findAllBaseDict() {
		// TODO Auto-generated method stub
		List<BaseDict> allBaseDict = baseDictMapper.findAllBaseDict();
		return allBaseDict;
	}

	@Override
	public List<BaseDict> findBaseDictByType(String dictId, String dictTypeName, String dictItemName, Integer dictSort,
			String dictEnable, String dictMemo) {
		// TODO Auto-generated method stub
		List<BaseDict> byType = baseDictMapper.findBaseDictByType(dictId, dictTypeName, dictItemName, dictSort, dictEnable, dictMemo);
		return byType;
	}

	
}
